/*
 * Copyright The OpenTelemetry Authors
 * SPDX-License-Identifier: Apache-2.0
 */

package com.xiashitech.agent.instrumentation.tomcat.common;

import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapSetter;
import org.apache.catalina.connector.Response;

import javax.annotation.Nullable;

public enum TomcatResponseSetter implements TextMapSetter<Response> {
  INSTANCE;

  @Override
  public void set(@Nullable Response carrier, String key, String value) {
    if (carrier == null) {
      return;
    }
    carrier.setHeader(key, value);
  }
}
